package com.bjsxt.controller;

import com.bjsxt.pojo.Host;
import com.bjsxt.pojo.PageA;

import com.bjsxt.service.HostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/host")
public class HostController {

    @Autowired
    private HostService  hostService;

    //批量修改主持人账号状态实现
    @RequestMapping("/changeStatus")
    public  Integer    changeStatus(Integer[] hids,String status){
         return   hostService.changeStatus(hids, status);
    }

    //添加主持人实现
    @RequestMapping("/saveHost")
    public   Integer   saveHost(Host host){

        return   hostService.save(host);
    }


    //修改主持人权重实现
    @RequestMapping("/changeHostStrong")
    public   Integer   changeHostStrong(Integer  strong,Integer hid){

        return   hostService.changeStrong(strong, hid);
    }


    @RequestMapping("/findMoreHost")
    public PageA<Host> findMoreHost(Integer page,Integer  rows,Host host){

        System.out.println(host);

        return  hostService.findMore(page, rows,host);
    }

}
